package tests;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JSplitPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import fr.imag.ufrima.ctte.TaskDiagram;
import fr.imag.ufrima.ctte.gui.editors.TaskDiagramEditor;
import fr.imag.ufrima.ctte.gui.menus.MainMenuBar;
import fr.imag.ufrima.ctte.gui.toolbars.MainToolBar;
import fr.imag.ufrima.ctte.gui.views.MapSubView;
import fr.imag.ufrima.ctte.gui.views.TaskPropertiesSubView;
import fr.imag.ufrima.ctte.gui.views.TaskTreeSubView;

public class JeTest extends JFrame {
	MyPanel myPanel = new MyPanel();
	public static void main(String[] args) {
		try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	    } catch (InstantiationException e) {
	    } catch (ClassNotFoundException e) {
	    } catch (UnsupportedLookAndFeelException e) {
	    } catch (IllegalAccessException e) {}

		new JeTest();
	}
	public JeTest(){
		super("ImagCTTE [Bassem DEBBABI & Yassine CHAOUFE]");
		InitComponents();						
		this.setVisible(true);
		JButton b = new JButton("repaint");
		b.addActionListener(new ActionListener(){			
			public void actionPerformed(ActionEvent arg0) {
				Graphics g = myPanel.image.getGraphics();
				g.drawLine(0, 0, 100, 100);
				myPanel.repaint();
				
			}
		});
		myPanel.add(b);
		pack();
		
	}
	/**
	 * Initialize components
	 */
	protected void InitComponents(){	
        // main window properties
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("ImagCTTE   [Bassem DEBBABI & Yassine CHAOUFE]");
        setSize(new Dimension(800,600));
		setPreferredSize(new Dimension(800,600));
		setLocationRelativeTo(null);
        
		this.getContentPane().add(myPanel);
		
		pack();
		
	}
}

